﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Microsoft.Cryptography.Samples.WCFService01Host
{
    class Program
    {
        static void Main(string[] args)
        {
            System.ServiceModel.ServiceHost host = null;
            try
            {
                host = new System.ServiceModel.ServiceHost(typeof(Microsoft.Cryptography.Samples.WCF.SayHelloWorldService));
                host.Faulted += new EventHandler(host_Faulted);
                
                host.Open();
            }
            catch (Exception error)
            {
                Console.WriteLine(error);
            }

            Console.WriteLine();
            Console.WriteLine("Press any key to quit program...");
            Console.ReadKey();
            if (host != null)
            {
                host.Close();
            }
        }

        static void host_Faulted(object sender, EventArgs e)
        {
            Console.WriteLine("Fehler aufgetreten. Sender: {0}, EventArgs: {1}",
                sender,
                e);
        }
    }
}
